package service;

import entity.Reservation;

import java.util.List;

/***
 * Author: Mr.Zhao, Time: 2019/5/23/17:02
 * Description:
 */
public interface ReservationService {

    /**
     * 通过用户名查找预约记录
     *
     * @param username
     * @return
     */
    List<Reservation> selectByUsername(String username) throws Exception;

    /**
     * 添加预约记录
     *
     * @param reservation 预约实体
     * @return 成功返回标志
     */
    int addReservation(Reservation reservation) throws Exception;


    /**
     * 选择所有未审核的预约申请，不返回过期记录
     *
     * @return
     */
    List<Reservation> selectNotAuditedReservation() throws Exception;


    /**
     * 选择所有已审核的预约申请记录
     * @return
     * @throws Exception
     */
    List<Reservation> selectAuditedReservation() throws Exception;

    /**
     * 更新预约记录
     */
    void update(Reservation reservation) throws Exception;

    /**
     * 根据教室id查询预约记录
     * @param classroomId
     * @return
     */
    List<Reservation> selectByClassroomId(Integer classroomId) throws Exception;
}
